Reference Expressions
References are compound names that refer to objects in applications, the system, or AppleScript. Because each object has a value, a reference can be
used to represent a value in a script. A reference expression is a reference
that AppleScript interprets as a value.A reference can function as a reference to an object or as a reference expression. When a reference is the direct parameter of a command, it usually functions as a reference to an object, indicating to which object the command should be sent. In most other cases, references function as expressions, which AppleScript evaluates by getting their values.
For example, the reference in the following example is a reference to an object. It identifies the object to which the Copy command is sent.
copy word 1 of front document of application "Scriptable Text Editor"On the other hand, the reference in the following example is a reference expression:
repeat (word 1 of front document of application ÿ "Scriptable Text Editor") times display dialog "Hello"end repeatWhen AppleScript executes the statement, it gets the value of the reference word 1 of front document of application "Scriptable Text Editor"--a string--and then coerces it to an integer, if possible. (For information about the Repeat statement, refer to Chapter 7, "Control Statements." For information about coercions, refer to "Coercing Values"
on page 66.)